
function $( elementId )
{
	return (
		document.getElementById( elementId )
	);
}

window.onload = function()
{
	if ( this.onload.fpList )
	{
		for( var i = 0; i < this.onload.fpList.length; i++ )
		{
			var fp = this.onload.fpList[i];

			if ( $.isProc( fp ) ) {

				fp();
			}
		}
	}
};

window.onload.add = function( fp )
{
	if ( !window.onload.fpList )
	{
		window.onload.fpList = [];
	}

	window.onload.fpList.push( fp );
};

$.ie = function(){
	return(navigator.userAgent.indexOf("MSIE") > 0);
};

$.navigate = function(spec)
{
	location.href = spec;
};
$.navigateConfirm = function( $text, $url )
{
	if( window.confirm( $text ) ) {
		$.navigate( $url );
	}
};
$.ready = window.onload.add;

$.eval = function($code, $globalScope)
{
	// TODO Investigar ejecución de eval en contexto global.
	//
	if ( !$code )
		return(false);

	try {
		var $retVal = window.eval($code);
	}
	catch(err) {
		window.$.error.append(err);

		return(false);
	}
	return($retVal || true);
}
